<div>
    <el-form    label-width="100%">
        <el-form-item label="">
        </el-form-item>
    </el-form>



    <el-button v-if="!parentData"  type="primary" @click="add"  icon="plus">新增</el-button>

    <el-form label-width="100%">
        <el-form-item label="">
        </el-form-item>
    </el-form>
    <el-row type="flex" justify="space-around">
        <el-col :span="16">
            <el-table :data ="serviceItems" border stripe @row-click="showChildren">
                <el-table-column prop="itemName"  label="地服项" min-width="70">
                </el-table-column>
                <el-table-column prop="useInImport" label="状态" min-width="50" >
                    <template scope = "scope">
                      <span>
                          {{scope.row.status?"启用":"禁用"}}
                      </span>
                    </template>
                </el-table-column>
                <el-table-column prop="useInImport" label="进港" min-width="50" >
                    <template scope = "scope">
                      <span>
                          {{scope.row.useInImport?"启用":"禁用"}}
                      </span>
                    </template>
                </el-table-column>
                <el-table-column prop="useInExport" label="出港"  min-width="50">
                    <template scope = "scope">
                      <span>
                          {{scope.row.useInExport?"启用":"禁用"}}
                      </span>
                    </template>
                </el-table-column>
                <el-table-column prop="useInExport" label="中转" min-width="50">
                    <template scope = "scope">
                      <span>
                          {{scope.row.useInTransferProcess?"启用":"禁用"}}
                      </span>
                    </template>
                </el-table-column>
                <el-table-column label="进港服务时间" min-width="100">
                    <template scope = "scope">
                    <span>
                        {{scope.row.importDifference==null?"未配置":((scope.row.importTimeStrategy=="arriveTime"?"落地后":" 起飞前")+(scope.row.importDifference)+"分钟")}}
                    </span>
                    </template>
                </el-table-column>
                <el-table-column label="出港服务时间" min-width="100">
                    <template scope = "scope">
                    <span>
                        {{scope.row.exportDifference==null?"未配置":((scope.row.exportTimeStrategy=="arriveTime"?"落地后":" 起飞前")+(scope.row.exportDifference)+"分钟")}}
                    </span>
                    </template>
                </el-table-column>
                <el-table-column label="中转服务时间"min-width="100">
                    <template scope = "scope">
                    <span>
                        {{scope.row.transferProcessDifference==null?"未配置":((scope.row.transferProcessStrategy=="arriveTime"?"落地后":" 起飞前")+(scope.row.transferProcessDifference)+"分钟")}}
                    </span>
                    </template>
                </el-table-column>

                <el-table-column fixed="right" label="配置" min-width="132">
                    <template scope = "scope">
                        <el-button type="text" icon="edit" size="small" @click="editItem(scope)">编辑</el-button>
                        <el-button type="text" icon="edit" @click="addUser(scope)" size="small">人员</el-button>
                        <el-button type="text" icon="edit" @click="addVehicle(scope)" size="small">车辆</el-button>
                    </template>
                </el-table-column>

            </el-table>
        </el-col>
        <el-col :span="7">
            <el-collapse v-model="activeNames" >
                <el-collapse-item :title="currentItem.itemName?currentItem.itemName+'地服人员':'地服人员'" name="1">
                   <el-table :data="currentItem.teams">
                       <el-table-column prop="teamName">
                       </el-table-column>
                   </el-table>
                </el-collapse-item>
                <el-collapse-item :title="currentItem.itemName?currentItem.itemName+'车辆':'车辆'" name="2">
                    <el-table :data="currentItem.airSecurityVehicle">
                        <el-table-column prop="vehicleName">
                        </el-table-column>
                    </el-table>
                </el-collapse-item>
            </el-collapse>
        </el-col>
    </el-row>

    <el-dialog
            title="地服项配置"
            :visible.sync="formDialog"
            width="45%"
           >
        <el-form ref="dataForm" :model="dataForm" label-width="100px" >
            <el-row>
                <el-col :span="11">
                    <el-form-item label="地服项" class="thin-item" prop="itemName" >
                        <el-input v-model="dataForm.itemName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="7">
                    <el-form-item label="排班基数" class="thin-item" prop="scheduleBaseNum">
                        <el-input v-model.number="dataForm.scheduleBaseNum"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                        <el-form-item label="按组排班" class="thin-item"  prop="hasGroup">
                            <el-checkbox  v-model="dataForm.hasGroup"></el-checkbox>
                        </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="18">
                    <el-form-item label="进港服务时间"  class="thin-item" prop="importDifference" >
                        <el-row>
                            <el-col :span="7" style="text-align: center">
                                <span>落地后</span>
                            </el-col>
                            <el-col :span="12">
                                <el-input v-model.number="dataForm.importDifference"></el-input>
                            </el-col>
                            <el-col :span="5"  style="text-align: center">
                                <span>分钟</span>
                            </el-col>
                        </el-row>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="进港启用"  class="thin-item" prop="useInImport">
                        <el-checkbox  v-model="dataForm.useInImport"></el-checkbox>
                    </el-form-item>
                </el-col>
                </el-row>
            <el-row>
                <el-col :span="18">
                    <el-form-item label="出港服务时间" class="thin-item" prop="exportDifference" >
                        <el-row>
                            <el-col :span="7" style="text-align: center">
                                <span>起飞前</span>
                            </el-col>
                            <el-col :span="12">
                                <el-input v-model.number="dataForm.exportDifference"></el-input>
                            </el-col>
                            <el-col :span="5"  style="text-align: center">
                                <span>分钟</span>
                            </el-col>
                        </el-row>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="出港启用" class="thin-item" prop="useInExport">
                        <el-checkbox  v-model="dataForm.useInExport"></el-checkbox>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="18">
                    <el-form-item label="中转服务时间" class="thin-item" prop="transferProcessDifference" >
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" class="thin-item" prop="transferProcessStrategy" >
                                    <el-select v-model="dataForm.transferProcessStrategy" placeholder="请选择">
                                        <el-option
                                                v-for="item in timeType"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-input v-model.number="dataForm.transferProcessDifference"></el-input>
                            </el-col>
                            <el-col :span="5"  style="text-align: center">
                                <span>分钟</span>
                            </el-col>
                        </el-row>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="中转启用" class="thin-item" prop="useInTransferProcess">
                        <el-checkbox  v-model="dataForm.useInTransferProcess"></el-checkbox>
                    </el-form-item>
                </el-col>
            </el-row>



            <el-row>
                <el-col :span="18">
                    <el-form-item label="启用">
                        <el-switch v-model="dataForm.status"
                                   on-color="#15D592" off-color="#99A9BF" on-text="启用" on-value="true" off-text="停用" off-value="false">
                        </el-switch>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="5">
                    <el-form-item>
                        <el-button type="primary"  @click="update">确定</el-button>
                    </el-form-item>
                </el-col>
                <el-col :span="5">
                    <el-form-item>
                        <el-button @click="formDialog=false">取消</el-button>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </el-dialog>




    <el-dialog :title="'配置'+currentService.itemName+'服务人员'" :visible.sync="dialog"  row-click="" style="text-align: center;" >
        <kf-table-transfer v-model="transferResult" :data="allTeams" :titles="['未选用户','可调配人员']" >
            <template slot="left-columns">
                <el-table-column label="部门名称" prop="teamName" header-align="center"></el-table-column>
            </template>
            <template slot="right-columns">
                <el-table-column label="部门名称" prop="teamName" header-align="center"></el-table-column>
            </template>
        </kf-table-transfer>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialog = false">取 消</el-button>
            <el-button type="primary" @click="addUserComplete">确 定</el-button>
        </div>
    </el-dialog>

    <el-dialog title="车辆配置" :visible.sync="dialogVehicle"  row-click="" style="text-align: center;" >
        <kf-table-transfer v-model="selectVehicles" :data="allVehicles" :titles="['未选','可调配车辆']" >
            <template slot="left-columns">
                <el-table-column label="车辆名称" prop="vehicleName" header-align="center"></el-table-column>
            </template>
            <template slot="right-columns">
                <el-table-column label="车辆名称" prop="vehicleName" header-align="center"></el-table-column>
            </template>
        </kf-table-transfer>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogVehicle = false">取 消</el-button>
            <el-button type="primary" @click="addVehicleComplete">确 定</el-button>
        </div>
    </el-dialog>



</div>



